import request from '@/utils/request';

export interface LoginParamsType {
  username: string;
  password: string;
  mobile: string;
  captcha: string;
}

export async function getCaptcha() {
  var curTemp = new Date().getTime()
  return request(`/app-admin/sys/randomImage/${curTemp}?_t=${Number.parseInt(curTemp/1000)}`);
}

export async function accountLogin(params: LoginParamsType) {
  return request('/app-admin/sys/login', {
    method: 'POST',
    data: {
      ...params,
      remember_me: true,
      checkKey: new Date().getTime(),
      captcha:'LRiX88WchyS8FPa9'
    }
  })
}
